import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 邓大帅
 * Date: 2022-11-16
 * Time: 10:56
 */
public class LoginTest {
    public static void main(String[] args) {
        System.out.println("请输入密码：");
        Scanner input = new Scanner(System.in);
        String S = "5201314";
        int num = 3;
        while(num != 0){
            String s = input.nextLine();
            if (S.equals(s)) {
                System.out.println("登陆成功");
                break;
            }
            if (num > 1) {
                System.out.println("密码错误，请重新输入");
            }
            num--;
        }
        if (num == 0) {
            System.out.println("三次密码输入错误，登陆失败");
        }
    }
}
